<template>
  <div class="contain-playlist">
    <h5 class='fc333 fs12 like-title pb10 solid-border-bottom'>包含这首歌的歌单</h5>
    <div class="contain-ul mt20">
        <ul v-for="item in simiPlaylistData" :key=item.key>
            <li class='clearfix contain-li mb10'>
                <div class="fl">
                    <a class="disinblock" @click='routerPlaylist(item.id)'>
                        <img class="contain-img" :src=item.coverImgUrl :title=item.name>
                    </a>
                </div>
                <div class="fr contain-li-con ml10">
                    <a class='disinblock fs14 contain-name'
                    :title=item.name @click='routerPlaylist(item.id)'>{{ item.name }}</a>
                    <a href="javascript:;" :title=item.creator.nickname 
                      class='fs12 contain-playlist-author fcgray'>by {{ item.creator.nickname }}</a>
                </div>
            </li>
        </ul>
    </div>
  </div>
</template>

<script>
export default {
  name: "containPlaylist",
  props: ["simiPlaylist"],
  data() {
      return {
        simiPlaylistData: []
      }
  },
  methods: {
    routerPlaylist(row){
      this.$router.push({path:'/playlist', query:{ id:row}})
    }
  },
  watch: {
    simiPlaylist() {
      this.simiPlaylistData = this.simiPlaylist
    }
  }
}
</script>

<style scoped lang="less">
  .contain-playlist {
    width: 100%;
    height: auto;
    .contain-ul {
      width: 100%;
      .contain-li {
        display: flex;
        width: 100%;
        .contain-img {
          width: 50px;
          height: 50px;
        }
        .contain-li-con {
          width: calc(100% - 50px);
          .contain-name {
            width: 100%;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
          }
        }
      }
    }
  }
</style>